// 管理员登录接口
const express = require('express');
const router = express.Router();
const db = require('../../db/connect');
const xzid = require('xzid')

router.get('/admin/getDataReport', (req, res) => {
    const sql = ` SELECT manger_declare.*,manger_cost.*,manger_order.*
    FROM manger_declare
    INNER JOIN manger_cost ON manger_cost.cost_room_id = manger_declare.declare_room_id
    INNER JOIN manger_order ON manger_order.order_room_id = manger_cost.cost_room_id
    where manger_declare.declare_room_id = '538150-546-a237-3f21-f6ec3cec3aba'`;
    db(sql ,(err, data) => {
        if (data.length>0) {
           res.send({
                data,
                code:200
           })
        } else {
            res.send({
                code: 400,
                content: err,
                message: '告诉他账户不存在'
            })
        }
    })
})
module.exports = router